package au.edu.unsw.bookmarket.jdo;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import javax.jdo.annotations.PersistenceCapable;

@PersistenceCapable
public class Book {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    @Persistent
    private String name;
    @Persistent
    private String author;
    @Persistent
    private String edition;
    @Persistent
    private int year;
    @Persistent
    private String isbn;
    @Persistent
    private String publisher;
    @Persistent
    private String type;
    @Persistent
    private Double full_price;
    @Persistent
    private boolean predefined;

    public Book(String name, String author, String edition, int year,
            String isbn, String publisher, String type, Double full_price, boolean predefined) {
        super();
        this.name = name;
        this.author = author;
        this.edition = edition;
        this.year = year;
        this.isbn = isbn;
        this.publisher = publisher;
        this.type = type;
        this.full_price = full_price;
        this.predefined = predefined;
    }

    public Book() {
    }

    public Key getKey() {
        return key;
    }

    public void setKey(Key key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getEdition() {
        return edition;
    }

    public void setEdition(String edition) {
        this.edition = edition;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Double getFull_price() {
        return full_price;
    }

    public void setFull_price(Double full_price) {
        this.full_price = full_price;
    }

    public boolean isPredefined() {
        return predefined;
    }

    public void setPredefined(boolean predefined) {
        this.predefined = predefined;
    }
}
